package com.xinsoft.entity.dto;

import com.xinsoft.entity.po.SysWarehouse;
import com.xinsoft.utils.TokenUtil;
import lombok.Data;

/**
 *  @author: π
 *  仓库
 */
@Data
public class KisWareHouseDto {

    private String  FItemId;        //"内码"
    private String  FNumber;        //"编码"
    private String  FName;          //"名称"

    private String  FTypeID;              //"仓库类型"
    private String  FTypeID_FName;        //"仓库类型"

    private String  FEmpID;         //"仓库管理员"
    private String  FEmpID_FName;   //"仓库管理员"
    private String  FAddress;       //"仓库地址"
    private String  FProperty;      //"仓库属性"
    private String  FProperty_FName;      //"仓库属性"
    private String  FUnderStock;          //"允许负库存"
    private String  FMRPAvail;            //"是否MRP可用量"
    private String  FIsStockMgr;          //"是否进行仓位管理"
    private String  FSPGroupID;           //"仓位组"  与库位对应
    private String  FSPGroupID_FName;     //"仓位组"

//    {
//        "FRECORDS": 1,
//            "FItemId": 11940,
//            "FNumber": "20",
//            "FName": "金来",
//            "FParentId": 0,
//            "FEmpID": 0,
//            "FEmpID_FName": "*",
//            "FAddress": null,
//            "FProperty": 0,
//            "FProperty_FName": null,
//            "FTypeID": 500,
//            "FTypeID_FName": "普通仓",
//            "FSPGroupID": 0,
//            "FSPGroupID_FName": "*"
//    }
    public static SysWarehouse voToPo(KisWareHouseDto vo) {
        if (vo == null) {
            return null;
        }
        SysWarehouse sysWarehouse = new SysWarehouse();
        sysWarehouse.setId(new Integer(vo.getFItemId()));
        sysWarehouse.setWarehouseCode(vo.getFNumber());
        sysWarehouse.setWarehouseName(vo.getFName());
        sysWarehouse.setGroupKis(vo.getFSPGroupID());
        sysWarehouse.setTypeName(vo.getFTypeID_FName());
        sysWarehouse.setAuditStatus(1);
        sysWarehouse.setAuditId(TokenUtil.getUserId());
        return sysWarehouse;
    }

}
